﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Networking
{
    // A class for pushing events across a network view.
	public class EventQueue
    {

        public EventQueue()
        {
        }

        #region Member Data

        private Queue<GameEvent> gameEvents = new Queue<GameEvent>();

        #endregion

        #region Methods

        public void AddEvent(GameEvent gameEvent)
        {
            gameEvents.Enqueue(gameEvent);
        }

        public GameEvent GetNextEvent()
        {
            if (gameEvents.Count > 0)
                return gameEvents.Dequeue();
            return null;
        }

        public int Count
        {
            get {
                return gameEvents.Count;
            }
        }

        #endregion

	}
}
